var app = getApp();

module.exports = function (url, data, method) {
  // 基于 Promise 封装
  return new Promise((resolve, reject) => {
    wx.request({
      url: `https://liangzhunglobal.com/ovuola/${url}`,
      // url: `https://192.168.199.126/${url}`,
      data: data,
      header: {
        'content-type': 'application/x-www-form-urlencoded',
        'Authorization': app.loginUser.token
      },
      success: resolve,
      fail: reject,
      method: method,
    })
  })
}